package {{packageName}}.core.{{entity.module}}.mapping;

import org.mapstruct.*;
import {{packageName}}.core.{{entity.module}}.domain.{{entity.domainClassName}};
{{#each entity.indexRelations as |indexRelation|}}
import {{packageName}}.core.{{indexRelation.module}}.domain.{{indexRelation.relEntity.domainClassName}};
{{/each}}
import java.util.List;

/**
 * {{entity.logicName}}继承映射[{{entity.codeName}}]
 *
 * @author generator
 */
@Mapper(componentModel = "spring", uses = {}, nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE, nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface {{entity.codeName}}InheritMapping {

    {{#each entity.indexRelations as |indexRelation|}}
    /**
     * 转换{{indexRelation.relEntity.codeName}}
     * 
     * @param {{camelCase entity.codeName}}
     * @return
     */
    @Mappings({
    {{#each indexRelation.lookup2 as |lookup|}}
    {{#neq lookup.codeName lookup.refCodeName}}
        @Mapping(source ="{{camelCase lookup.codeName}}",target = "{{camelCase lookup.refCodeName}}"),
    {{/neq}}
    {{/each}}
    })
    {{indexRelation.relEntity.domainClassName}} to{{pascalCase indexRelation.relEntity.codeName}}({{entity.domainClassName}} {{camelCase entity.codeName}});

    /**
     * 转换 {{entity.codeName}}
     * 
     * @param {{camelCase indexRelation.relEntity.codeName}}
     * @return
     */
    @Mappings({
    {{#each indexRelation.lookup1 as |lookup|}}
    {{#neq lookup.codeName lookup.refCodeName}}
        @Mapping(source ="{{camelCase lookup.refCodeName}}",target = "{{camelCase lookup.codeName}}"),
    {{/neq}}
    {{/each}}
    })
    {{entity.domainClassName}} to{{pascalCase entity.codeName}}({{indexRelation.relEntity.domainClassName}} {{camelCase indexRelation.relEntity.codeName}});
    {{/each}}

}